package com.yiren.backstage.currency.entity;
import org.greenrobot.greendao.DaoException;
import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.ToOne;
import org.greenrobot.greendao.annotation.Transient;

import java.util.List;
import com.yiren.backstage.db.dao.DaoSession;
import com.yiren.backstage.db.dao.StateMonitorEntityDao;
import com.yiren.backstage.db.dao.JudgeEntityDao;
import com.yiren.backstage.db.dao.JudgeDetailsEntityDao;

/**
 * Time:2021/10/29 9:41
 * Author:xiaozan
 * Description:评判详情 实体类
 */
@Entity(nameInDb = "judge_details", createInDb = false)
public class JudgeDetailsEntity {

    @Id
    private String id;

    /**父级评判详情*/
    private String  parentId;
    @ToOne(joinProperty = "parentId")
    private JudgeDetailsEntity parentJudgeDetails;

    /**所属评判*/
    private String    judgeId;
    @ToOne(joinProperty = "judgeId")
    private JudgeEntity judgeEntity;

    /**
     * 开始语音 语音文件名称-选择语音文件时
     * 内容为空时：取开始播报内容合成播报
     * 内容不为空时：根据当前语音文件名称播报本地语音
     */
    private String startVoiceName;

    /**开始播报内容*/
    private String startContent;

    /**条件参数*/
    private float conditionValue;

    /**条件要素  对应 ExecuteElementEnum）*/
    private String conditionElement;

    /**条件类型 对应 ExecuteTypeEnum*/
    private String conditionType;

    /**监控状态*/
    private String stateMonitorId;
    @ToOne(joinProperty = "stateMonitorId")
    private StateMonitorEntity stateMonitorEntity;

    /**执行参数*/
    private float executeValue;

    /**执行要素 对应 ExecuteElementEnum*/
    private String executeElement;

    //评判对应结果
    @Transient
    private List<JudgeResultEntity> judgeDetailsResultEntitys;

    /** Used to resolve relations */
    @Generated(hash = 2040040024)
    private transient DaoSession daoSession;

    /** Used for active entity operations. */
    @Generated(hash = 1441205967)
    private transient JudgeDetailsEntityDao myDao;



    @Generated(hash = 1214936551)
    public JudgeDetailsEntity(String id, String parentId, String judgeId, String startVoiceName,
            String startContent, float conditionValue, String conditionElement, String conditionType,
            String stateMonitorId, float executeValue, String executeElement) {
        this.id = id;
        this.parentId = parentId;
        this.judgeId = judgeId;
        this.startVoiceName = startVoiceName;
        this.startContent = startContent;
        this.conditionValue = conditionValue;
        this.conditionElement = conditionElement;
        this.conditionType = conditionType;
        this.stateMonitorId = stateMonitorId;
        this.executeValue = executeValue;
        this.executeElement = executeElement;
    }

    @Generated(hash = 1147328245)
    public JudgeDetailsEntity() {
    }

    @Generated(hash = 1698711838)
    private transient String parentJudgeDetails__resolvedKey;

    @Generated(hash = 1029132789)
    private transient String judgeEntity__resolvedKey;

    @Generated(hash = 485571722)
    private transient String stateMonitorEntity__resolvedKey;

   

    public List<JudgeResultEntity> getJudgeDetailsResultEntitys() {
        return judgeDetailsResultEntitys;
    }

    public void setJudgeDetailsResultEntitys(List<JudgeResultEntity> judgeDetailsResultEntitys) {
        this.judgeDetailsResultEntitys = judgeDetailsResultEntitys;
    }

    public String getId() {
        return this.id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getParentId() {
        return this.parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getJudgeId() {
        return this.judgeId;
    }

    public void setJudgeId(String judgeId) {
        this.judgeId = judgeId;
    }

    public String getStartVoiceName() {
        return this.startVoiceName;
    }

    public void setStartVoiceName(String startVoiceName) {
        this.startVoiceName = startVoiceName;
    }

    public String getStartContent() {
        return this.startContent;
    }

    public void setStartContent(String startContent) {
        this.startContent = startContent;
    }

    public float getConditionValue() {
        return this.conditionValue;
    }

    public void setConditionValue(float conditionValue) {
        this.conditionValue = conditionValue;
    }

    public String getConditionElement() {
        return this.conditionElement;
    }

    public void setConditionElement(String conditionElement) {
        this.conditionElement = conditionElement;
    }

    public String getConditionType() {
        return this.conditionType;
    }

    public void setConditionType(String conditionType) {
        this.conditionType = conditionType;
    }

    public String getStateMonitorId() {
        return this.stateMonitorId;
    }

    public void setStateMonitorId(String stateMonitorId) {
        this.stateMonitorId = stateMonitorId;
    }

    public float getExecuteValue() {
        return this.executeValue;
    }

    public void setExecuteValue(float executeValue) {
        this.executeValue = executeValue;
    }

    public String getExecuteElement() {
        return this.executeElement;
    }

    public void setExecuteElement(String executeElement) {
        this.executeElement = executeElement;
    }

    /** To-one relationship, resolved on first access. */
    @Generated(hash = 683084257)
    public JudgeDetailsEntity getParentJudgeDetails() {
        String __key = this.parentId;
        if (parentJudgeDetails__resolvedKey == null || parentJudgeDetails__resolvedKey != __key) {
            final DaoSession daoSession = this.daoSession;
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            JudgeDetailsEntityDao targetDao = daoSession.getJudgeDetailsEntityDao();
            JudgeDetailsEntity parentJudgeDetailsNew = targetDao.load(__key);
            synchronized (this) {
                parentJudgeDetails = parentJudgeDetailsNew;
                parentJudgeDetails__resolvedKey = __key;
            }
        }
        return parentJudgeDetails;
    }

    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 1224767075)
    public void setParentJudgeDetails(JudgeDetailsEntity parentJudgeDetails) {
        synchronized (this) {
            this.parentJudgeDetails = parentJudgeDetails;
            parentId = parentJudgeDetails == null ? null : parentJudgeDetails.getId();
            parentJudgeDetails__resolvedKey = parentId;
        }
    }

    /** To-one relationship, resolved on first access. */
    @Generated(hash = 2042024408)
    public JudgeEntity getJudgeEntity() {
        String __key = this.judgeId;
        if (judgeEntity__resolvedKey == null || judgeEntity__resolvedKey != __key) {
            final DaoSession daoSession = this.daoSession;
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            JudgeEntityDao targetDao = daoSession.getJudgeEntityDao();
            JudgeEntity judgeEntityNew = targetDao.load(__key);
            synchronized (this) {
                judgeEntity = judgeEntityNew;
                judgeEntity__resolvedKey = __key;
            }
        }
        return judgeEntity;
    }

    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 1834375858)
    public void setJudgeEntity(JudgeEntity judgeEntity) {
        synchronized (this) {
            this.judgeEntity = judgeEntity;
            judgeId = judgeEntity == null ? null : judgeEntity.getId();
            judgeEntity__resolvedKey = judgeId;
        }
    }

    /** To-one relationship, resolved on first access. */
    @Generated(hash = 677700488)
    public StateMonitorEntity getStateMonitorEntity() {
        String __key = this.stateMonitorId;
        if (stateMonitorEntity__resolvedKey == null || stateMonitorEntity__resolvedKey != __key) {
            final DaoSession daoSession = this.daoSession;
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            StateMonitorEntityDao targetDao = daoSession.getStateMonitorEntityDao();
            StateMonitorEntity stateMonitorEntityNew = targetDao.load(__key);
            synchronized (this) {
                stateMonitorEntity = stateMonitorEntityNew;
                stateMonitorEntity__resolvedKey = __key;
            }
        }
        return stateMonitorEntity;
    }

    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 1452546670)
    public void setStateMonitorEntity(StateMonitorEntity stateMonitorEntity) {
        synchronized (this) {
            this.stateMonitorEntity = stateMonitorEntity;
            stateMonitorId = stateMonitorEntity == null ? null : stateMonitorEntity.getId();
            stateMonitorEntity__resolvedKey = stateMonitorId;
        }
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#delete(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 128553479)
    public void delete() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.delete(this);
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#refresh(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 1942392019)
    public void refresh() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.refresh(this);
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#update(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 713229351)
    public void update() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.update(this);
    }

    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 1341330372)
    public void __setDaoSession(DaoSession daoSession) {
        this.daoSession = daoSession;
        myDao = daoSession != null ? daoSession.getJudgeDetailsEntityDao() : null;
    }
}
